@section('content-header')
    @php
        use Illuminate\Support\Facades\Auth;
        use App\Modules\User\Models\Admin;
        $user = Auth::user();
    @endphp
    <ul class="nav d-tabs clearfix">
        @if($user->is_merchant_staff == Admin::MERCHANT_AUTH)
            @php
                $shop = \App\Modules\Shop\Shop::query()->whereIn("id",json_decode($user->shop_id,true))->get();
                $package=0;$good = 0;
                foreach ($shop as $s){
                    if($s->is_photography == 1){
                        $package++;
                    }
                     if($s->is_photography == 0){
                        $good++;
                    }
                }
            @endphp

            @if($package > 0)
                <li class="{{ $sidebar == "package"? "active" : "" }}"><a
                        href="{{ route('admin.order.package_index', array_merge(request()->except(['start', 'end', 'page']), ['referrer_id' => $referrerId ??null])) }}">套系订单</a>
                </li>
            @endif
            @if($good > 0)
                <li class="{{ $sidebar == "good"? "active" : "" }}"><a
                        href="{{ route('admin.order.good_index', array_merge(request()->except(['start', 'end', 'page']), ['referrer_id' => $referrerId ??null])) }}">商品订单</a>
                </li>
            @endif

            {{--        <li class="{{ $sidebar == "prepay"? "active" : "" }}"><a href="{{ route('admin.order.prepay_index', ['name' => $name ?? null] ) }}">预付款订单</a></li>--}}
            @can('merchant_staff_order_create')
                <li class="{{ $sidebar == "create"? "active" : "" }}"><a
                        href="{{ route('admin.order.create') }}">创建订单</a></li>
            @endcan
        @else
            @can('package-order')
                <li class="{{ $sidebar == "package"? "active" : "" }}"><a
                        href="{{ route('admin.order.package_index', array_merge(request()->except(['start', 'end', 'page']), ['referrer_id' => $referrerId ??null])) }}">套系订单</a>
                </li>
            @endcan
            @can('goods-order')
                <li class="{{ $sidebar == "good"? "active" : "" }}"><a
                        href="{{ route('admin.order.good_index', array_merge(request()->except(['start', 'end', 'page']), ['referrer_id' => $referrerId ??null])) }}">商品订单</a>
                </li>
            @endcan
            {{--        <li class="{{ $sidebar == "prepay"? "active" : "" }}"><a href="{{ route('admin.order.prepay_index', ['name' => $name ?? null] ) }}">预付款订单</a></li>--}}
            @can('order-create')
                <li class="{{ $sidebar == "create"? "active" : "" }}"><a
                        href="{{ route('admin.order.create') }}">创建订单</a></li>
            @endcan
        @endif

    </ul>
@endsection
